/*需要切换的颜色变量*/
$_color:#f00;
/* 更换的颜色 */
$color-primary2:#3588CB;
/* 更换的颜色 */
$color-primary3:#7D0000;
/* 更换的颜色 */
$color-primary4:#EB6100;
/* 更换的颜色 */

/*定义方法*/
@mixin color($color) {
  color: $color;

  /*判断匹配*/
  [data-theme="primary1"] & {
    color: $_color;
  }

  [data-theme="primary2"] & {
    color: $color-primary2;
  }

  [data-theme="primary3"] & {
    color: $color-primary3;
  }

  [data-theme="primary4"] & {
    color: $color-primary4;
  }
}

@mixin backgroundColor($color) {
    background-color: $color;
  
    /*判断匹配*/
    [data-theme="primary1"] & {
        background-color: $_color;
    }
  
    [data-theme="primary2"] & {
        background-color: $color-primary2;
    }
  
    [data-theme="primary3"] & {
        background-color: $color-primary3;
    }
  
    [data-theme="primary4"] & {
        background-color: $color-primary4;
    }
  }